import React, { Component } from 'react';
import '../../style/Index/Swiper.css'
import { Input, Swiper, Skeleton } from 'antd-mobile'
import services from '../../api/interface'
class Swiperr extends Component {
    state = {
        bannerlist: []
    }
    async componentDidMount() {
        var res = await services.city.banner_list()
        this.setState({
            bannerlist: res.data.data
        })

        console.log(res);
    }
    render() {
        return (
            <div className='swiper'>
                <Swiper autoplay loop allowTouchMove autoplayInterval={2000}>
                    <Skeleton.Title />
                    <Skeleton.Paragraph />
                    {
                        this.state.bannerlist.map((item, index) => {
                            return (
                                <Swiper.Item key={index}>
                                    <img src={item.img} alt="" />
                                </Swiper.Item>
                            )
                        })
                    }
                </Swiper>
            </div>
        );
    }
}

export default Swiperr;